﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for tblLMGTransferDataCMI

/// Table Name : [tblLMGTransferDataCMI]
/// Created By : CX
/// Created Date : Wednesday, April 20, 2011
/// </summary>
/// 
namespace CE.Transfer
{

    public class TransferLMGCMIDB
    {
        public TransferLMGCMIDB()
        {	//TODO: Add constructor logic here

        }

        public Int64 Insert(TransferLMGCMI transfer)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocInsert]";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@ExportId", transfer.ExportId);
            _sPara.Add("@REFERENCE_NO", transfer.REFERENCE_NO);
            _sPara.Add("@POLICY_LINE_OF_BUSINESS", transfer.POLICY_LINE_OF_BUSINESS);
            _sPara.Add("@POLICY_NO", transfer.POLICY_NO);
            _sPara.Add("@TAX_NOTE_DATE", transfer.TAX_NOTE_DATE);
            _sPara.Add("@LINK_REFERENCE_NO", transfer.LINK_REFERENCE_NO);
            _sPara.Add("@POLICY_EFFECTIVE_DATE", transfer.POLICY_EFFECTIVE_DATE);
            _sPara.Add("@POLICY_EXPIRATION_DATE", transfer.POLICY_EXPIRATION_DATE);
            _sPara.Add("@ENTRY_DATE", transfer.ENTRY_DATE);
            _sPara.Add("@SIGN_DATE", transfer.SIGN_DATE);
            _sPara.Add("@SALUTATION", transfer.SALUTATION);
            _sPara.Add("@INSURED_NAME", transfer.INSURED_NAME);
            _sPara.Add("@INSURED_TYPE", transfer.INSURED_TYPE);
            _sPara.Add("@INSURED_SEX", transfer.INSURED_SEX);
            _sPara.Add("@ADDRESS_LINE1", transfer.ADDRESS_LINE1);
            _sPara.Add("@ADDRESS_LINE2", transfer.ADDRESS_LINE2);
            _sPara.Add("@TUMBON", transfer.TUMBON);
            _sPara.Add("@DISTRICT", transfer.DISTRICT);
            _sPara.Add("@STATE_PROVINCE", transfer.STATE_PROVINCE);
            _sPara.Add("@POSTAL_CODE", transfer.POSTAL_CODE);
            _sPara.Add("@COUNTRY", transfer.COUNTRY);
            _sPara.Add("@EMAIL_SEND_POLICY", transfer.EMAIL_SEND_POLICY);
            _sPara.Add("@MOBILE_PHONE_NO_1", transfer.MOBILE_PHONE_NO_1);
            _sPara.Add("@MOBILE_PHONE_NO_2", transfer.MOBILE_PHONE_NO_2);
            _sPara.Add("@HOME_PHONE_NO", transfer.HOME_PHONE_NO);
            _sPara.Add("@HOME_PHONE_EXTENSION_NO", transfer.HOME_PHONE_EXTENSION_NO);
            _sPara.Add("@OFFICE_PHONE_NO", transfer.OFFICE_PHONE_NO);
            _sPara.Add("@OFFICE_PHONE_EXTENSION_NO", transfer.OFFICE_PHONE_EXTENSION_NO);
            _sPara.Add("@ID_CARD_NO", transfer.ID_CARD_NO);
            _sPara.Add("@BIRTH_DATE", transfer.BIRTH_DATE);
            _sPara.Add("@MARITAL_STATUS", transfer.MARITAL_STATUS);
            _sPara.Add("@HOBBY", transfer.HOBBY);
            _sPara.Add("@AGENT_CODE", transfer.AGENT_CODE);
            _sPara.Add("@BROKER_CODE", transfer.BROKER_CODE);
            _sPara.Add("@PRODUCT_CODE", transfer.PRODUCT_CODE);
            _sPara.Add("@CAMPAIGN_CODE", transfer.CAMPAIGN_CODE);
            _sPara.Add("@MOTOR_CODE", transfer.MOTOR_CODE);
            _sPara.Add("@MOTOR_SUB_CODE", transfer.MOTOR_SUB_CODE);
            _sPara.Add("@VEHICLE_MAKE", transfer.VEHICLE_MAKE);
            _sPara.Add("@VEHICLE_MODEL", transfer.VEHICLE_MODEL);
            _sPara.Add("@VEHICLE_MODEL_TYPE", transfer.VEHICLE_MODEL_TYPE);
            _sPara.Add("@VEHICLE_STICKER_NO", transfer.VEHICLE_STICKER_NO);
            _sPara.Add("@VEHICLE_PREFIX_LICENSE_NO", transfer.VEHICLE_PREFIX_LICENSE_NO);
            _sPara.Add("@VEHICLE_LICENSE_NO", transfer.VEHICLE_LICENSE_NO);
            _sPara.Add("@KEY_FIELD", transfer.KEY_FIELD);
            _sPara.Add("@VEHICLE_CHASSIS_NO", transfer.VEHICLE_CHASSIS_NO);
            _sPara.Add("@VEHICLE_ENGINE_NO", transfer.VEHICLE_ENGINE_NO);
            _sPara.Add("@VEHICLE_REGISTRATION_NO", transfer.VEHICLE_REGISTRATION_NO);
            _sPara.Add("@GPRM", transfer.GPRM);
            _sPara.Add("@TAX", transfer.TAX);
            _sPara.Add("@STAMP", transfer.STAMP);
            _sPara.Add("@VEHICLE_NO_OF_SEAT", transfer.VEHICLE_NO_OF_SEAT);
            _sPara.Add("@VEHICLE_ENGINE_CAPACITY", transfer.VEHICLE_ENGINE_CAPACITY);
            _sPara.Add("@VEHICLE_WEIGHT", transfer.VEHICLE_WEIGHT);
            _sPara.Add("@COVER_NOTE_DATE", transfer.COVER_NOTE_DATE);
            _sPara.Add("@BC_POLICY_NO", transfer.BC_POLICY_NO);

            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

        public bool Update()
        {
            return true;
        }

        public bool Delete(Int64 id)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocDelete]";

            SortedList _sPara = new SortedList();


            #region Parameter
            //_sPara.Add("@ID", id);
            //_sPara.Add("@ID2", id2);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result > 0;
        }


    }


}



